package com.wenbai.servicelightluxurystickers.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.wenbai.servicelightluxurystickers.entity.StickCategory;
import com.wenbai.servicelightluxurystickers.mapper.StickCategoryMapper;
import com.wenbai.servicelightluxurystickers.service.StickCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class StickCategoryImpl implements StickCategoryService {
    @Autowired
    private StickCategoryMapper stickCategoryMapper;

    @Override
    public List<StickCategory> selectCategory() {
        LambdaQueryWrapper<StickCategory> queryWrapper = new LambdaQueryWrapper<>();
        return stickCategoryMapper.selectList(queryWrapper);
    }

    /**
     * 新增类别
     * @param stickCategory
     */
    @Override
    public void save(StickCategory stickCategory) {
        stickCategoryMapper.insert(stickCategory);
    }

    @Override
    public void deldte(String id) {
        stickCategoryMapper.deleteById(id);
    }

    @Override
    public void update(StickCategory stickCategory) {
        stickCategoryMapper.updateById(stickCategory);
    }
}
